home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Utilities / Programming / EnterAct 3.5 / Drag_on Modules / hAWK programs / $ExtractExternRefs < prev    next >
Encoding:
Text File  |  1991-11-03  |  513 b   |  20 lines  |  [TEXT/KEEN]

  1. # $ExtractExternRefs - a simple version, with no comment skipping.
  2. #Prints all "extern" references on per-file basis, sticking
  3. #line number before each reference.
  4. #Typically use the "MFS selected files" input option
  5. #output goes to stdout
  6.  
  7. FNR == 1 {    n = split(FILENAME, names, ":")
  8.             print names[n] ":" }
  9. nosemi == 1 { print " ", $0
  10.               if (match($0, /;/) > 0)
  11.                   nosemi = 0
  12.               next
  13.             }
  14. $1 ~ /\bextern\b/ { print FNR, "\t", $0
  15.                 if (match($0, /;/) > 0)
  16.                   nosemi = 0
  17.                 else
  18.                     nosemi = 1
  19.               }
  20.